/* Copyright (c) 2010 OFXKit
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#import <Foundation/Foundation.h>

#import "OFXSecurity.h"
#import "OFXInvestmentTransaction.h"
#import "OFXInvestmentAccount.h"
#import "OFXCurrency.h"

@interface OFXInvestmentSplit : OFXInvestmentTransaction {
  OFXSecurity* security;
  NSString* securitySubAccount;
  NSString* fundingSubAccount;
  NSNumber* unitsOld;
  NSNumber* unitsNew;
  NSNumber* splitRatioNumerator;
  NSNumber* splitRationDenominator;

  OFXCurrency* originalCurrency;
  
  NSNumber* fractionalUnitsCash;
}

/**
 * @property security
 * @brief Underlying security.
 */
@property(retain) OFXSecurity* security;

/**
 * @property securitySubAccount
 * @brief Sub-account type for the security: CASH, MARGIN, SHORT, OTHER
 */
@property(retain) NSString* securitySubAccount;

/**
 * @property fundingSubAccount
 * @brief Where did the money for the transaction come from or go to? 
 * 
 * Valid values:
 * - CASH
 * - MARGIN
 * - SHORT
 * - OTHER
 */
@property(retain) NSString* fundingSubAccount;

/**
 * @property unitsOld
 * @brief Number of shares before the split
 */
@property(retain) NSNumber* unitsOld;

/**
 * @property unitsNew
 * @brief Number of shares after the split
 */
@property(retain) NSNumber* unitsNew;

/**
 * @property splitRatioNumerator
 * @brief Numerator of split ratio
 */
@property(retain) NSNumber* splitRatioNumerator;

/**
 * @property splitRationDenominator
 * @brief Denominator of split ratio
 */
@property(retain) NSNumber* splitRationDenominator;

/**
 * @property originalCurrency
 * @brief Original currency of transaction.
 */
@property(retain) OFXCurrency* originalCurrency;

/**
 * @property fractionalUnitsCash
 * @brief Cash for fractional units.
 */
@property(retain) NSNumber* fractionalUnitsCash;

@end
